package com.shiro.receiver.entity;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Payload<T> {

    private String id;

    @JsonProperty("op")
    private Integer operationType;

    @JsonProperty("s")
    private Long sequence;

    @JsonProperty("t")
    private String eventType;

    @JsonProperty("d")
    private T data;

    public Payload(String id, Integer operationType, Long sequence, String eventType) {
        this.id = id;
        this.operationType = operationType;
        this.sequence = sequence;
        this.eventType = eventType;
    }

}
